(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^2).


The TRS R consists of the following rules:

eq(0, 0) → true
eq(0, s(X)) → false
eq(s(X), 0) → false
eq(s(X), s(Y)) → eq(X, Y)
rm(N, nil) → nil
rm(N, add(M, X)) → ifrm(eq(N, M), N, add(M, X))
ifrm(true, N, add(M, X)) → rm(N, X)
ifrm(false, N, add(M, X)) → add(M, rm(N, X))
purge(nil) → nil
purge(add(N, X)) → add(N, purge(rm(N, X)))

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted Cpx (relative) TRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

eq(0, 0) → true
eq(0, s(z0)) → false
eq(s(z0), 0) → false
eq(s(z0), s(z1)) → eq(z0, z1)
rm(z0, nil) → nil
rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
purge(nil) → nil
purge(add(z0, z1)) → add(z0, purge(rm(z0, z1)))
Tuples:

EQ(0, 0) → c
EQ(0, s(z0)) → c1
EQ(s(z0), 0) → c2
EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, nil) → c4
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(nil) → c8
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
S tuples:

EQ(0, 0) → c
EQ(0, s(z0)) → c1
EQ(s(z0), 0) → c2
EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, nil) → c4
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(nil) → c8
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
K tuples:none
Defined Rule Symbols:

eq, rm, ifrm, purge

Defined Pair Symbols:

EQ, RM, IFRM, PURGE

Compound Symbols:

c, c1, c2, c3, c4, c5, c6, c7, c8, c9

(3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID) transformation)

Removed 5 trailing nodes:

EQ(s(z0), 0) → c2
EQ(0, s(z0)) → c1
PURGE(nil) → c8
EQ(0, 0) → c
RM(z0, nil) → c4

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

eq(0, 0) → true
eq(0, s(z0)) → false
eq(s(z0), 0) → false
eq(s(z0), s(z1)) → eq(z0, z1)
rm(z0, nil) → nil
rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
purge(nil) → nil
purge(add(z0, z1)) → add(z0, purge(rm(z0, z1)))
Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
S tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
K tuples:none
Defined Rule Symbols:

eq, rm, ifrm, purge

Defined Pair Symbols:

EQ, RM, IFRM, PURGE

Compound Symbols:

c3, c5, c6, c7, c9

(5) CdtUsableRulesProof (EQUIVALENT transformation)

The following rules are not usable and were removed:

purge(nil) → nil
purge(add(z0, z1)) → add(z0, purge(rm(z0, z1)))

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

eq(0, 0) → true
eq(0, s(z0)) → false
eq(s(z0), 0) → false
eq(s(z0), s(z1)) → eq(z0, z1)
rm(z0, nil) → nil
rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
S tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
K tuples:none
Defined Rule Symbols:

eq, rm, ifrm

Defined Pair Symbols:

EQ, RM, IFRM, PURGE

Compound Symbols:

c3, c5, c6, c7, c9

(7) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
We considered the (Usable) Rules:

rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
rm(z0, nil) → nil
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
And the Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(EQ(x1, x2)) = 0   
POL(IFRM(x1, x2, x3)) = 0   
POL(PURGE(x1)) = x1   
POL(RM(x1, x2)) = 0   
POL(add(x1, x2)) = [1] + x2   
POL(c3(x1)) = x1   
POL(c5(x1, x2)) = x1 + x2   
POL(c6(x1)) = x1   
POL(c7(x1)) = x1   
POL(c9(x1, x2)) = x1 + x2   
POL(eq(x1, x2)) = 0   
POL(false) = 0   
POL(ifrm(x1, x2, x3)) = x3   
POL(nil) = 0   
POL(rm(x1, x2)) = x2   
POL(s(x1)) = 0   
POL(true) = 0   

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

eq(0, 0) → true
eq(0, s(z0)) → false
eq(s(z0), 0) → false
eq(s(z0), s(z1)) → eq(z0, z1)
rm(z0, nil) → nil
rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
S tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
K tuples:

PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
Defined Rule Symbols:

eq, rm, ifrm

Defined Pair Symbols:

EQ, RM, IFRM, PURGE

Compound Symbols:

c3, c5, c6, c7, c9

(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
We considered the (Usable) Rules:

rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
rm(z0, nil) → nil
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
And the Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(EQ(x1, x2)) = [1]   
POL(IFRM(x1, x2, x3)) = [2]x3   
POL(PURGE(x1)) = [2]x12   
POL(RM(x1, x2)) = [2] + [2]x2   
POL(add(x1, x2)) = [2] + x2   
POL(c3(x1)) = x1   
POL(c5(x1, x2)) = x1 + x2   
POL(c6(x1)) = x1   
POL(c7(x1)) = x1   
POL(c9(x1, x2)) = x1 + x2   
POL(eq(x1, x2)) = 0   
POL(false) = 0   
POL(ifrm(x1, x2, x3)) = x3   
POL(nil) = 0   
POL(rm(x1, x2)) = x2   
POL(s(x1)) = 0   
POL(true) = 0   

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

eq(0, 0) → true
eq(0, s(z0)) → false
eq(s(z0), 0) → false
eq(s(z0), s(z1)) → eq(z0, z1)
rm(z0, nil) → nil
rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
S tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
K tuples:

PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
Defined Rule Symbols:

eq, rm, ifrm

Defined Pair Symbols:

EQ, RM, IFRM, PURGE

Compound Symbols:

c3, c5, c6, c7, c9

(11) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
We considered the (Usable) Rules:

rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
rm(z0, nil) → nil
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
And the Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(EQ(x1, x2)) = [2] + x1   
POL(IFRM(x1, x2, x3)) = x3 + [2]x2·x3   
POL(PURGE(x1)) = x12   
POL(RM(x1, x2)) = [2] + x1 + x2 + [2]x1·x2   
POL(add(x1, x2)) = [2] + x1 + x2   
POL(c3(x1)) = x1   
POL(c5(x1, x2)) = x1 + x2   
POL(c6(x1)) = x1   
POL(c7(x1)) = x1   
POL(c9(x1, x2)) = x1 + x2   
POL(eq(x1, x2)) = 0   
POL(false) = 0   
POL(ifrm(x1, x2, x3)) = x3   
POL(nil) = 0   
POL(rm(x1, x2)) = x2   
POL(s(x1)) = [1] + x1   
POL(true) = 0   

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

eq(0, 0) → true
eq(0, s(z0)) → false
eq(s(z0), 0) → false
eq(s(z0), s(z1)) → eq(z0, z1)
rm(z0, nil) → nil
rm(z0, add(z1, z2)) → ifrm(eq(z0, z1), z0, add(z1, z2))
ifrm(true, z0, add(z1, z2)) → rm(z0, z2)
ifrm(false, z0, add(z1, z2)) → add(z1, rm(z0, z2))
Tuples:

EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
S tuples:none
K tuples:

PURGE(add(z0, z1)) → c9(PURGE(rm(z0, z1)), RM(z0, z1))
RM(z0, add(z1, z2)) → c5(IFRM(eq(z0, z1), z0, add(z1, z2)), EQ(z0, z1))
IFRM(true, z0, add(z1, z2)) → c6(RM(z0, z2))
IFRM(false, z0, add(z1, z2)) → c7(RM(z0, z2))
EQ(s(z0), s(z1)) → c3(EQ(z0, z1))
Defined Rule Symbols:

eq, rm, ifrm

Defined Pair Symbols:

EQ, RM, IFRM, PURGE

Compound Symbols:

c3, c5, c6, c7, c9

(13) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)

The set S is empty

(14) BOUNDS(1, 1)